package Terminal.TechnicalServices.Mapper;

import Terminal.Entity.Dominio.ELineaRegola;
import Terminal.Entity.Dominio.ELineaTimeRecord;
import Terminal.Entity.IceClasses.ELineaRegolaI;
import Terminal.Entity.IceClasses.ELineaTimeRecordI;

public class MLineaTimeRecord implements Mapper {

	@Override
	public ELineaTimeRecordI getIceObj(Object hibObj) {

		ELineaTimeRecordI iceLineaTimeRecord = null;
		
		if ( hibObj instanceof ELineaTimeRecord)
		{
			iceLineaTimeRecord = new ELineaTimeRecordI();
			
			iceLineaTimeRecord.costo = ((ELineaRegola) hibObj).getCosto();
			iceLineaTimeRecord.descrizione = ((ELineaRegola) hibObj).getDescrizione();
			iceLineaTimeRecord.misura = ((ELineaRegola) hibObj).getMisura();
		}
		
		return iceLineaTimeRecord;
	}

	@Override
	public ELineaTimeRecord getHibObj(Object iceObj) {

		ELineaTimeRecord hibLineaTimeRecord = null;
		
		if ( iceObj instanceof ELineaTimeRecordI)
		{
			hibLineaTimeRecord = new ELineaTimeRecord();
			
			hibLineaTimeRecord.setCosto(((ELineaRegolaI) iceObj).costo);
			hibLineaTimeRecord.setDescrizione(((ELineaRegolaI) iceObj).descrizione);
			hibLineaTimeRecord.setMisura(((ELineaRegolaI) iceObj).misura);
		}
		
		return hibLineaTimeRecord;
		
	}	
	
}
